home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
basic
/
Mildred.lha
/
lha
/
ILBMviewer.lha
/
ILBMviewer.ascii
< prev
next >
Wrap
Text File
|
1998-11-25
|
2KB
|
100 lines
WBStartup
;Main
DEFTYPE.w
INCLUDE "Prefs.bb2"
INCLUDE "Variables.bb2"
INCLUDE "Chunky.bb2"
INCLUDE "Display.bb2"
MReservec2pWindows 4
MReserveBitmaps 3
MaxLen ASLfile$=256
MaxLen ASLpath$=256
ASLpath$="Data:Pictures/IFF1"
FindScreen 0
Land$=ASLFileRequest$("Choose an ILBM picture)",ASLpath$,ASLfile$)
If InitLand{Land$,0,0,0}=False Then Goto Finish
YOff.l=(LandHeight-ILBMActualHeight)*LandWidth
ChunkyCopy16{LandBuffer+YOff,LandBuffer2+YOff,ILBMActualHeight,CPUminimum,LandWidth,LandWidth} ; Duplicate
If InitDisplay{"Game"}=False Then Goto Finish
ShowPalette 0
Multitasking{On}
buf.b=0
its.l=0
*Scr._Screen=Peek.l(Addr Screen(0))
xmult.q=(LandWidth-PrefDisplayWidth)/PrefDisplayWidth
ymult.q=(LandHeight-PrefDisplayHeight)/PrefDisplayHeight
LandX.w=0
LandY.w=0
MemOffset.l=0
For mode.b=0 To 3
If mode MOD 2=1 Then Mc2pRowLacing On Else Mc2pRowLacing Off
If mode>1 Then Mc2pColumnLacing On Else Mc2pColumnLacing Off
Mc2pWindow mode,PrefDisplayWidth,PrefDisplayHeight,LandWidth,CPUminimum,PrefDisplayWidth,PrefDisplayHeight
Next mode
Mc2pRowLacing PrefDisplayLacing
Mc2pColumnLacing PrefDisplayColumning
c2pLaceMode.b=PrefDisplayLacing+(PrefDisplayColumning LSL 1)
M040c2pUsage On
MCPU CPUminimum
Mc2pCPUmode CPUminimum
ResetTimer
While Joyb(0)<>1 AND Joyb(1)=0
If Joyb(0)=2
c2pLaceMode+1
If c2pLaceMode=4 Then c2pLaceMode=0
If c2pLaceMode MOD 2=1 Then Mc2pRowLacing On Else Mc2pRowLacing Off
If c2pLaceMode>1 Then Mc2pColumnLacing On Else Mc2pColumnLacing Off
VWait 25
its=0
ResetTimer
EndIf
If PrefDisplayBuffering>1
buf+1
If buf=PrefDisplayBuffering Then buf=0
EndIf
Mc2pToggle PrefDisplayBuffering,buf
LandX.w=SMouseX*xmult
LandY=SMouseY*ymult
If IsAGA
Mc2p c2pLaceMode,MBitmapPtr(LandX,LandY),PlanarBuf(buf)
ShowBitMap buf
Else
*RP._RastPort=RastPort(buf)
For Y=0 To PrefDisplayHeight-1
WritePixelLine8_ *RP,0,Y,PrefDisplayWidth-1,MemOffset+(LandWidth*Y),0
Next Y
*ScrVP\DyOffset=BufNum*PrefDisplayHeight
ScrollVPort_ *ScrVP
EndIf
its+1
Wend
t=Timer
t=Max(t,1)
its=Max(its,1)
a.q=50.0/(t/its)
ScreenToBack_ NPeekL(Addr Screen(0))
VWait 50
FindScreen 1
Window 2,16,16,300,40,0,"Test results",1,0
WindowOutput 2
NPrint a," frames per second"
NPrint " "
NPrint "Press mouse/joy button..."
Repeat
Until Joyb(0)<>0 OR Joyb(1)<>0
Finish:
Multitasking{On}
End